/**
 * Created with JetBrains WebStorm.
 * User: Tobi
 * Date: 7/21/12
 * Time: 11:31 AM
 * To change this template use File | Settings | File Templates.
 */

$('#search').keypress(function (e) {
    if (e.keyCode == 13) {
        handler();
    }
});

function handler(){
    var searchString    = $("#search").val();
    // forming the queryString
    //var data            = 'search='+ searchString;

    // if searchString is not empty
    /*
    if(searchString) {
        // ajax call
        $.ajax({
            type: "POST",
            url: "do_search.php",
            data: data,
            beforeSend: function(html) { // this happens before actual call
                $("#results").html('');
                $("#searchresults").show();
                $(".word").html(searchString);
            },
            success: function(html){ // this happens after we get results
                $("#results").show();
                $("#results").append(html);
            }
        });
    }*/
    alert(searchString);
}